
<div class="order-list-page" ng-if="pagedata.op == 'list'">
    <div class="fui-header">
		<div class="fui-header-left" ng-click="goback()">
            <a class="back"></a>
        </div>
		<div class="title">我的表单</div>
		<div class="fui-header-right"></div>
	</div>
	<div id="tab" class="fui-tab fui-tab-danger">
        <a ng-class="{'external active':pagedata.status ==10}" href="javascript:" ng-click="tool.get_list('core/member.diyform/list/status=10',true);pagedata.status=10">全部</a>
        <a ng-class="{'external active':pagedata.status == 0}" href="javascript:" ng-click="tool.get_list('core/member.diyform/list/status=0',true);pagedata.status=0">待付款</a>
        <a ng-class="{'external active':pagedata.status == 1}" href="javascript:" ng-click="tool.get_list('core/member.diyform/list/status=1',true);pagedata.status=1">已付款</a>
        <a ng-class="{'external active':pagedata.status == 2}" href="javascript:" ng-click="tool.get_list('core/member.diyform/list/status=2',true);pagedata.status=2">待处理</a>
        <a ng-class="{'external active':pagedata.status == 3}" href="javascript:" ng-click="tool.get_list('core/member.diyform/list/status=3',true);pagedata.status=3">已取消</a>
        <a ng-class="{'external active':pagedata.status == 4}" href="javascript:" ng-click="tool.get_list('core/member.diyform/list/status=4',true);pagedata.status=4">已完成</a>
    </div>
	<div class='fui-content navbar order-list' style="margin-top:2px">
	<div class="fui-list-group order-item" ng-repeat="item in pagedata.list">
                <a class="fui-list external" style="padding: 0.42rem 0.5rem" data-nocache="true">
                    <div class="fui-list-inner">
                        <div class="subtitle"> 表单号: {{item.id}}</div>
                    </div>
                    <div class="row-remark text-cancel" style="width: 4rem; font-size: 0.65rem;text-align: right;">{{item.statustitle}}</div>
                    <div class="angle"></div>
                </a> 
                    <a href="" class="external" data-nocache="true" ng-click="access_json('core/member.diyform/detail/id='+item.id)">
                        <div class="fui-list goods-list">
                            <div class="fui-list-inner">
                                <div class="text goodstitle towline">{{item.title || '表单名称'}}</div>
								<div class="text" ng-repeat="d in item.data" style="color:#f60;font-size:0.50rem">{{d.title}}：{{d.data}}</div>
                            </div>
                            <div class="fui-list-angle" style="width:4rem">
                                ￥<span class="marketprice">{{item.fee || '0.00'}}</span></div>
                        </div>
                    </a>
                <div class="fui-list-group-title lineblock">
					<span style="color:#999;font-size:0.55rem"><i class="icon jinyunicon icon-shijian" style="color:#f60;font-size:0.50rem"></i> {{item.createtime}}</span>
                    <span class="status noremark">共 <span>1</span> 个表单 实付: <span class="text-danger">￥{{item.fee}}</span></span>
                </div>
            <div class="fui-list-group-title lineblock opblock">
				<span class="status noremark">
					<div ng-show="item.status == 0" class="btn btn-sm btn-default-o order-delete" href="javascript:" ng-click="post({},'core/member.diyform/del/','id='+item.id)">删除表单</div>
					<div ng-show="item.status == 0 && item.fee>0" class="btn btn-sm btn-danger-o order-finish" href="javascript:" ng-click="pay_submit({},'core/member.diyform/pay/id='+item.id)">支付表单</div>
					<div ng-show="item.status == 2" class="btn btn-sm btn-danger-o order-finish" href="javascript:" ng-click="post({},'core/member.diyform/receive/','id='+item.id)">确认服务</div>
				</span>
            </div>
        </div>
	</div>
	<div class="content-empty" ng-show="pagedata.list.length == 0 ">
		  <i class="icon jinyunicon icon-cry" style="width: 6rem;margin-bottom: 0.5rem;"></i><br/><p style="color: #999;font-size: .75rem">您暂时没有表单！</p>
	</div>
</div>
<div class="order-list-page" ng-if="pagedata.op == 'detail'">
    <div class="fui-header">
		<div class="fui-header-left" ng-click="goback()">
            <a class="back"></a>
        </div>
		<div class="title">表单详情</div>
		<div class="fui-header-right"></div>
	</div>
	<div class='fui-content member-page'>
		<div class="fui-list-group merchgroup">
			<div class="fui-list jump">
                <a class="fui-list-media">
                    <img class="round" src="{{tomedia(pagedata.member.avatar) || '../core/resource/images/nopic.jpg'}}" />
                </a>
                <div class="fui-list-inner">
                    <!--<div class="title">{{pagedata.user.name || '匿名用户'}}</div>
					<div class="title" style="font-size:0.65rem">手机号：{{pagedata.user.mobile}}</div> -->
					<div class="title" style="font-size:0.65rem">昵称：{{pagedata.member.nickname}}</div>
					
                </div>
                <a class="jump" href="javascript:;">
					
				</a>
            </div>
		</div>
		<div class="weui_cells">
			<div class="weui_cell">
					<div class="weui_cell_bd weui_cell_primary">
						<span>表单项目</span>
					</div>
					<div class="weui_cell_ft" ng-model="pagedata.post.serve_title">{{pagedata.order.title}}</div>
			</div>
			<div class="weui_cell">
					<div class="weui_cell_bd weui_cell_primary">
						<span>表单人</span>
					</div>
					<div class="weui_cell_ft" ng-model="pagedata.post.package_title">{{pagedata.member.nickname}}</div>
			</div>
			<div class="weui_cell">
					<div class="weui_cell_bd weui_cell_primary">
						<span>联系电话</span>
					</div>
					<div class="weui_cell_ft" ng-model="pagedata.post.package_title">{{pagedata.member.mobile}}</div>
			</div>
			<div class="weui_cell">
					<div class="weui_cell_bd weui_cell_primary">
						<span>备注</span>
					</div>
					<div class="weui_cell_ft" ng-model="pagedata.post.time">{{pagedata.order.remark}}</div>
			</div>
		<!--	<div class="weui_cell">
					<div class="weui_cell_bd weui_cell_primary">
						<span>门店地址</span>
					</div>
					<div class="weui_cell_ft" ng-model="pagedata.post.address">{{pagedata.basic.address}}</div>
			</div>
			-->
			<div class="weui_cell">
					<div class="weui_cell_bd weui_cell_primary">
						<span>表单费用</span>
					</div>
					<div class="weui_cell_ft" ng-model="pagedata.order.fee">{{pagedata.order.fee}}元</div>
			</div>
			<div class="weui_cell">
					<div class="weui_cell_bd weui_cell_primary">
						<span>实际支付 </span><span class="red"> ({{pagedata.order.paytype || '无'}})</span>
					</div>
					<div class="weui_cell_ft" ng-model="pagedata.post.package_price">{{pagedata.order.fee}}元</div>
			</div>
			<div class="weui_cell" ng-repeat="item in pagedata.fileds">
					<div ng-if="item.type != 3" class="weui_cell_bd weui_cell_primary">
						<span>{{item.title}}</span>
					</div>
					<div ng-if="item.type != 3" class="weui_cell_ft" ng-model="pagedata.post.package_price">{{item.data}}</div>
					<div ng-if="item.type == 3" class="weui_cell_bd weui_cell_primary">
						<span>{{item.title}}</span>
					</div>
					 <a class="fui-list-media" ng-if="item.type == 3">
                    <img class="round" src="{{tomedia(item.data) || '../core/resource/images/nopic.jpg'}}" />
                </a>
			</div>
		</div>
	</div>
</div>
<div ng-include="sys_html('_footer')"></div>
<script type="text/javascript">
scope.tool.get_list('core/member.diyform/list/',true);
scope.pagedata.scroll_bottom=function(){
		scope.tool.get_list('core/member.diyform/list/');
}
scope.pagedata.pay=function(id){
	scope.post_json('core/member.diyform/pay/',{'id':id},function(res){
			if(res.payid){
				require(['tool'],function(tool){
					tool.pay(res.payid,function(res){
						if(res.type=='success'){
							scope.message('支付成功！','','core/member.diyform//status=1');
							
						}else{
							scope.message('支付失败！失败原因：'+res.message,'error');
						}
					});
				});
			}
	});

}
</script>